﻿' ///////////////////////////////////////////////////////////////
' // This is generated code. 
' //////////////////////////////////////////////////////////////
' // Code is generated using LLBLGen Pro version: 2.6
' // Code is generated on: lundi 28 septembre 2009 23:24:55
' // Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
' // Templates vendor: Solutions Design.
' // Templates version: 
' //////////////////////////////////////////////////////////////
Imports System
Imports System.ComponentModel
Imports System.Data
Imports System.Collections
#If Not CF Then
Imports System.Runtime.Serialization
#End If

Imports Aricie.DNN.Services.Url.FriendlyUrl.EntityClasses
Imports Aricie.DNN.Services.Url.FriendlyUrl.HelperClasses
Imports Aricie.DNN.Services.Url.FriendlyUrl.FactoryClasses

Imports SD.LLBLGen.Pro.ORMSupportClasses

' __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
' __LLBLGENPRO_USER_CODE_REGION_END
Namespace Aricie.DNN.Services.Url.FriendlyUrl.TypedListClasses

	''' <summary>
	''' Typed datatable for the list 'FupUrlMappings'.<br/><br/>
	''' 
	''' </summary>
	''' <remarks>
	''' The code doesn't support any changing of data. Users who do that are on their own.
	''' It also doesn't support any event throwing. This list should be used as a base for readonly databinding
	''' or dataview construction.
	''' </remarks>
#If Not CF Then	
	<Serializable(), System.ComponentModel.DesignerCategory("Code"), ToolboxItem(True), DesignTimeVisible(True)> _
	Public Class FupUrlMappingsTypedList 
#Else
	Public Class FupUrlMappingsTypedList 
#End If	
		Inherits TypedListBase2(Of FupUrlMappingsRow)
		Implements ITypedListLgp2
		' __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfacesList
		' __LLBLGENPRO_USER_CODE_REGION_END	

#Region "Class Member Declarations"
		Private _columnFriendlyUrl As DataColumn
		Private _columnRealUrl As DataColumn
		Private _fields As ResultsetFields
		Private _filterBucket As IRelationPredicateBucket 
		
		' __LLBLGENPRO_USER_CODE_REGION_START AdditionalMembers
		' __LLBLGENPRO_USER_CODE_REGION_END
		Private Shared _customProperties As Hashtable
		Private Shared _fieldsCustomProperties As Hashtable
#End Region

#Region "Class Constants"
		''' <summary>
		''' The amount of fields in the resultset.
		''' </summary>
		Private Const AmountOfFields As Integer = 2
#End Region
		
		''' <summary>
		''' Static CTor for setting up custom property hashtables. Is executed before the first instance of this
		''' class or derived classes is constructed. 
		''' </summary>
		Shared Sub New()
			SetupCustomPropertyHashtables()
		End Sub


		''' <summary>
		''' CTor
		''' </summary>
		Public Sub New()
			MyBase.New("FupUrlMappings")
			InitClass(False)
		End Sub
		
		
		''' <summary>
		''' CTor
		''' </summary>
		''' <param name="obeyWeakRelations">The flag to signal the collection what kind of join statements to generate in the
		''' query statement. Weak relationships are relationships which are optional, for example a
		''' customer with no orders is possible, because the relationship between customer and order is based on a field in order.
		''' When this property is set to true (default: false), weak relationships will result in LEFT JOIN statements. When
		''' set to false (which is the default), INNER JOIN statements are used.
		''' </param>
		Public Sub New(obeyWeakRelations As Boolean)
			MyBase.New("FupUrlMappings")
			InitClass(obeyWeakRelations)
		End Sub
		
#If Not CF Then		
		''' <summary>
		''' Protected constructor for deserialization.
		''' </summary>
		''' <param name="info"></param>
		''' <param name="context"></param>
		Protected Sub New(info As SerializationInfo, context As StreamingContext)
			MyBase.New(info, context)
			If SerializationHelper.Optimization = SerializationOptimization.None Then
				InitMembers()
				BuildResultset()
			End If
		End Sub
#End If		

		''' <summary>
		''' Gets the IEntityFields2 collection of fields of this typed list. Use this method in combination with the FetchTypedList() methods in DataAccessAdapter.
		''' </summary>
		''' <returns>Ready to use IEntityFields2 collection object.</returns>
		Public Function GetFieldsInfo() As IEntityFields2 Implements ITypedListLgp2.GetFieldsInfo
			Return _fields
		End Function


		''' <summary>
		''' Gets the IRelationPredicateBucket object which contains the relation information for this Typed List. Use this method in combination with the 
		''' FetchTypedList() methods in DataAccessAdapter.
		''' </summary>
		''' <returns>Ready to use IRelationPredicateBucket object.</returns>
		Public Function GetRelationInfo() As IRelationPredicateBucket Implements ITypedListLgp2.GetRelationInfo
			_filterBucket = New RelationPredicateBucket()
			BuildRelationSet()
			Return _filterBucket
		End Function

		''' <summary>Gets an array of all FupUrlMappingsRow objects.</summary>
		''' <returns>Array With FupUrlMappingsRow objects</returns>
		Public Shadows Function [Select]() As FupUrlMappingsRow()
			Return CType(MyBase.Select(), FupUrlMappingsRow())
		End Function


		''' <summary>Gets an array of all FupUrlMappingsRow objects that match the Filter criteria In order of primary key (Or lacking one, order of addition.) </summary>
		''' <param name="filterExpression">The criteria To use To Filter the rows.</param>
		''' <returns>Array With FupUrlMappingsRow objects</returns>
		Public Shadows Function [Select](filterExpression As String) As FupUrlMappingsRow()
			Return CType(MyBase.Select(filterExpression), FupUrlMappingsRow())
		End Function


		''' <summary>Gets an array of all FupUrlMappingsRow objects that match the Filter criteria, In the specified sort order</summary>
		''' <param name="filterExpression">The Filter expression.</param>
		''' <param name="sort">A String specifying the column And sort direction.</param>
		''' <returns>Array With FupUrlMappingsRow objects</returns>
		Public Shadows Function [Select](filterExpression As String, sort As String) As FupUrlMappingsRow()
			Return CType(MyBase.Select(filterExpression, sort), FupUrlMappingsRow())
		End Function


		''' <summary>Gets an array of all FupUrlMappingsRow objects that match the Filter criteria, In the specified sort order that match the specified state</summary>
		''' <param name="filterExpression">The Filter expression.</param>
		''' <param name="sort">A String specifying the column And sort direction.</param>
		''' <param name="recordStates">One of the <see cref="System.Data.DataViewRowState"/> values.</param>
		''' <returns>Array With FupUrlMappingsRow objects</returns>
		Public Shadows Function [Select](filterExpression As String, sort As String, recordStates As DataViewRowState) As FupUrlMappingsRow()
			Return CType(MyBase.Select(filterExpression, sort, recordStates), FupUrlMappingsRow())
		End Function


		''' <summary>
		''' Creates a New typed row during the build of the datatable during a Fill session by a dataadapter.
		''' </summary>
		''' <param name="rowBuilder">supplied row builder to pass to the typed row</param>
		''' <returns>the New typed datarow</returns>
		Protected Overrides Function NewRowFromBuilder(rowBuilder As DataRowBuilder) As DataRow
			Return New FupUrlMappingsRow(rowBuilder)
		End Function


		''' <summary>
		''' Builds the relation set for this typed list, inside the filterBucket object.
		''' </summary>
		Private Sub BuildRelationSet()
			_filterBucket.Relations.ObeyWeakRelations = MyBase.ObeyWeakRelations

			
			' __LLBLGENPRO_USER_CODE_REGION_START AdditionalRelations
			' __LLBLGENPRO_USER_CODE_REGION_END
			OnRelationSetBuilt(_filterBucket.Relations)
		End Sub


		''' <summary>
		''' Builds the resultset fields, stored in the Private _fields object
		''' </summary>
		Private Sub BuildResultset()
			_fields = New ResultsetFields(AmountOfFields)
			_fields.DefineField(FupUrlMappingFields.FriendlyUrl, 0, "FriendlyUrl", "", AggregateFunction.None)
			_fields.DefineField(FupUrlMappingFields.RealUrl, 1, "RealUrl", "", AggregateFunction.None)
			
			' __LLBLGENPRO_USER_CODE_REGION_START AdditionalFields
			' be sure To call _fields.Expand(number of New fields) first. 
			' __LLBLGENPRO_USER_CODE_REGION_END
			OnResultsetBuilt(_fields)
		End Sub


		''' <summary>
		''' Initialize the datastructures.
		''' </summary>
		''' <param name="obeyWeakRelations">flag for the internal used relations object</param>
		Protected Overrides Sub InitClass(obeyWeakRelations As Boolean)
			TableName = "FupUrlMappings"
			MyBase.ObeyWeakRelations = obeyWeakRelations
			
			_columnFriendlyUrl = New DataColumn("FriendlyUrl", GetType(System.String), Nothing, MappingType.Element)
			_columnFriendlyUrl.ReadOnly = True
			_columnFriendlyUrl.Caption = "FriendlyUrl"
			Me.Columns.Add(_columnFriendlyUrl)

			_columnRealUrl = New DataColumn("RealUrl", GetType(System.String), Nothing, MappingType.Element)
			_columnRealUrl.ReadOnly = True
			_columnRealUrl.Caption = "RealUrl"
			Me.Columns.Add(_columnRealUrl)
			
			' __LLBLGENPRO_USER_CODE_REGION_START InitClass
			' __LLBLGENPRO_USER_CODE_REGION_END

			BuildResultset()
			_filterBucket = New RelationPredicateBucket()
			BuildRelationSet()
			OnInitialized()
		End Sub


		''' <summary>
		''' Initializes the members, after a clone action.
		''' </summary>
		Private Sub InitMembers()
			_columnFriendlyUrl = Me.Columns("FriendlyUrl")
			_columnRealUrl = Me.Columns("RealUrl")
			
			' __LLBLGENPRO_USER_CODE_REGION_START InitMembers
			' __LLBLGENPRO_USER_CODE_REGION_END
			OnInitialized()
		End Sub


		''' <summary>
		''' Initializes the hashtables for the TypedList type and TypedList field custom properties. 
		''' </summary>
		Private Shared Sub SetupCustomPropertyHashtables()
			_customProperties = New Hashtable()
			_fieldsCustomProperties = New Hashtable()

			' Add per Field a new Hashtable with its custom properties, indexed by the name of the field.
			Dim fieldHashtable As Hashtable = Nothing

			fieldHashtable = New Hashtable()

			_fieldsCustomProperties.Add("FriendlyUrl", fieldHashtable)
			fieldHashtable = New Hashtable()

			_fieldsCustomProperties.Add("RealUrl", fieldHashtable)
		End Sub


		''' <summary>
		''' Return the type of the typed datarow
		''' </summary>
		''' <returns>returns the requested type</returns>
		Protected Overrides Function GetRowType() As Type
			Return GetType(FupUrlMappingsRow)
		End Function


		''' <summary>
		''' Clones this instance.
		''' </summary>
		''' <returns>A clone of this instance</returns>
		Public Overrides Function Clone() As DataTable
			Dim cloneToReturn As FupUrlMappingsTypedList = CType(MyBase.Clone(), FupUrlMappingsTypedList)
			cloneToReturn.InitMembers()
			Return cloneToReturn
		End Function

#If Not CF Then            
		''' <summary>
		''' Creates a New instance of the DataTable class.
		''' </summary>
		''' <returns>a New instance of a datatable with this schema.</returns>
		Protected Overrides Function CreateInstance() As DataTable
			Return New FupUrlMappingsTypedList()
		End Function
#End If

#Region "Class Property Declarations"
		''' <summary>
		''' Returns the amount of rows in this typed list.
		''' </summary>
		<System.ComponentModel.Browsable(False)> _
		Public Overloads Overrides ReadOnly Property Count As Integer
			Get 
				Return Me.Rows.Count
			End Get
		End Property
		
		''' <summary>
		''' The custom properties for this TypedList type.
		''' </summary>
		''' <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		Public Shared ReadOnly Property CustomProperties() As Hashtable
			Get
				Return _customProperties
			End Get
		End Property

		''' <summary>
		''' The custom properties for the type of this TypedList instance.
		''' </summary>
		''' <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		<System.ComponentModel.Browsable(False)> _
		Public Overridable ReadOnly Property CustomPropertiesOfType() As Hashtable
			Get
				Return FupUrlMappingsTypedList.CustomProperties
			End Get
		End Property

		''' <summary>
		''' The custom properties for the fields of this TypedList type. The returned Hashtable contains per fieldname a hashtable of name-value
		''' pairs. 
		''' </summary>
		''' <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		Public Shared ReadOnly Property FieldsCustomProperties() As Hashtable
			Get
				Return _fieldsCustomProperties
			End Get
		End Property

		''' <summary>
		''' The custom properties for the fields of the type of this TypedList instance. The returned Hashtable contains per fieldname a hashtable of name-value
		''' pairs. 
		''' </summary>
		''' <remarks>The data returned from this property should be considered read-only: it is not thread safe to alter this data at runtime.</remarks>
		<System.ComponentModel.Browsable(False)> _
		Public Overridable ReadOnly Property FieldsCustomPropertiesOfType() As Hashtable
			Get
				Return FupUrlMappingsTypedList.FieldsCustomProperties
			End Get
		End Property

		''' <summary>
		''' Indexer of this strong typed list
		''' </summary>
		Default ReadOnly Public Property  Item(index As Integer) As FupUrlMappingsRow
			Get 
				Return CType(Me.Rows(index), FupUrlMappingsRow)
			End Get
		End Property

	
		''' <summary>
		''' Returns the column object belonging to the TypedList field FriendlyUrl
		''' </summary>
		ReadOnly Friend Property FriendlyUrlColumn As DataColumn
			Get 
				Return _columnFriendlyUrl 
			End Get
		End Property
    
		''' <summary>
		''' Returns the column object belonging to the TypedList field RealUrl
		''' </summary>
		ReadOnly Friend Property RealUrlColumn As DataColumn
			Get 
				Return _columnRealUrl 
			End Get
		End Property
    
		
		' __LLBLGENPRO_USER_CODE_REGION_START AdditionalColumnProperties
		' __LLBLGENPRO_USER_CODE_REGION_END
#End Region

#Region "Custom TypedList code"
	
	' __LLBLGENPRO_USER_CODE_REGION_START CustomTypedListCode
	' __LLBLGENPRO_USER_CODE_REGION_END
#End Region

#Region "Included Code"

#End Region
	End Class


	''' <summary>
	''' Typed datarow for the typed datatable FupUrlMappings
	''' </summary>
	Public Class FupUrlMappingsRow 
		Inherits DataRow
		' __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfacesRow
		' __LLBLGENPRO_USER_CODE_REGION_END	
		
#Region "Class Member Declarations"
		Private _parent As FupUrlMappingsTypedList
#End Region

		''' <summary>
		''' CTor
		''' </summary>
		''' <param name="rowBuilder">Row builder object to use when building this row</param>
		Protected Friend Sub New(rowBuilder As DataRowBuilder)
			MyBase.New(rowBuilder) 
			_parent = CType(Me.Table, FupUrlMappingsTypedList)
		End Sub


#Region "Class Property Declarations"
	
		''' <summary>
		''' Gets / sets the value of the TypedList field FriendlyUrl<br/><br/>
		''' 
		''' </summary>
		''' <remarks>Mapped On: FupUrlMapping.FriendlyUrl</remarks>
		Public Property [FriendlyUrl]() As System.String
			Get 
				If IsFriendlyUrlNull() Then
					' return default value for this type.
					Return CType(TypeDefaultValue.GetDefaultValue(GetType(System.String)), System.String)
				Else
					Return CType(Me(_parent.FriendlyUrlColumn), System.String)
				End If
			End Get
			Set 
				Me(_parent.FriendlyUrlColumn) = Value
			End Set
		End Property

		''' <summary>
		''' Returns true if the TypedList field FriendlyUrl is NULL, false otherwise.
		''' </summary>
		Public Function IsFriendlyUrlNull() As Boolean
			Return IsNull(_parent.FriendlyUrlColumn)
		End Function

		''' <summary>
		''' Sets the TypedList field FriendlyUrl to NULL. Not recommended a typed list should be used
		''' as a readonly object.
		''' </summary>
    	Public Sub SetFriendlyUrlNull() 
			Me(_parent.FriendlyUrlColumn) = System.Convert.DBNull
		End Sub

	

		''' <summary>
		''' Gets / sets the value of the TypedList field RealUrl<br/><br/>
		''' 
		''' </summary>
		''' <remarks>Mapped On: FupUrlMapping.RealUrl</remarks>
		Public Property [RealUrl]() As System.String
			Get 
				If IsRealUrlNull() Then
					' return default value for this type.
					Return CType(TypeDefaultValue.GetDefaultValue(GetType(System.String)), System.String)
				Else
					Return CType(Me(_parent.RealUrlColumn), System.String)
				End If
			End Get
			Set 
				Me(_parent.RealUrlColumn) = Value
			End Set
		End Property

		''' <summary>
		''' Returns true if the TypedList field RealUrl is NULL, false otherwise.
		''' </summary>
		Public Function IsRealUrlNull() As Boolean
			Return IsNull(_parent.RealUrlColumn)
		End Function

		''' <summary>
		''' Sets the TypedList field RealUrl to NULL. Not recommended a typed list should be used
		''' as a readonly object.
		''' </summary>
    	Public Sub SetRealUrlNull() 
			Me(_parent.RealUrlColumn) = System.Convert.DBNull
		End Sub

	
#End Region

#Region "Custom TypedList Row code"
	
	' __LLBLGENPRO_USER_CODE_REGION_START CustomTypedListRowCode
	' __LLBLGENPRO_USER_CODE_REGION_END
#End Region
	End Class
End Namespace
